// components/c-filmcard/c-filmcard.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    imageUrl: {
      type: String,
      value: ''
    },
    title: {
      type: String,
      value: '',
      observer: function(newVal) {
        const maxLength = 7;
        if (newVal.length > maxLength) {
          this.setData({
            title: newVal.substring(0, maxLength) + '...'
          });
        }
      }
    },
    description: {
      type: String,
      value: '',
      observer: function(newVal) {
        const maxLength = 20;
        if (newVal.length > maxLength) {
          this.setData({
            description: newVal.substring(0, maxLength) + '...'
          });
        }
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {},

  /**
   * 组件的方法列表
   */
  methods: {}
});
